Diff
Modified: trunk/Source/WebCore/ChangeLog (196550 => 196551)
--- trunk/Source/WebCore/ChangeLog 2016-02-13 13:38:48 UTC (rev 196550)
+++ trunk/Source/WebCore/ChangeLog 2016-02-13 17:41:12 UTC (rev 196551)
@@ -1,3 +1,16 @@
+2016-02-13 Mark Lam <[email protected]>
+
+ Add thread violation checks to WebView public APIs.
+ https://bugs.webkit.org/show_bug.cgi?id=154183
+
+ Reviewed by Timothy Hatcher.
+
+ No new tests. Just adding a new thread violation round.
+
+ * platform/ThreadCheck.h:
+ * platform/mac/ThreadCheck.mm:
+ - Adding WebCoreThreadViolationCheckRoundThree().
+
2016-02-12 Nan Wang <[email protected]>
AX: Implement paragraph related text marker functions using TextIterator
Modified: trunk/Source/WebCore/platform/ThreadCheck.h (196550 => 196551)
--- trunk/Source/WebCore/platform/ThreadCheck.h 2016-02-13 13:38:48 UTC (rev 196550)
+++ trunk/Source/WebCore/platform/ThreadCheck.h 2016-02-13 17:41:12 UTC (rev 196551)
@@ -37,6 +37,7 @@
enum ThreadViolationRound {
ThreadViolationRoundOne = 0,
ThreadViolationRoundTwo,
+ ThreadViolationRoundThree,
MaximumThreadViolationRound
};
WEBCORE_EXPORT void setDefaultThreadViolationBehavior(ThreadViolationBehavior, ThreadViolationRound);
@@ -47,9 +48,11 @@
#define WebCoreThreadViolationCheckRoundOne() ::WebCore::reportThreadViolation(WTF_PRETTY_FUNCTION, WebCore::ThreadViolationRoundOne)
#define WebCoreThreadViolationCheckRoundTwo() ::WebCore::reportThreadViolation(WTF_PRETTY_FUNCTION, WebCore::ThreadViolationRoundTwo)
+#define WebCoreThreadViolationCheckRoundThree() ::WebCore::reportThreadViolation(WTF_PRETTY_FUNCTION, WebCore::ThreadViolationRoundThree)
#else
#define WebCoreThreadViolationCheckRoundOne() do { } while (0)
#define WebCoreThreadViolationCheckRoundTwo() do { } while (0)
+#define WebCoreThreadViolationCheckRoundThree() do { } while (0)
#endif // PLATFORM(IOS)
#endif
Modified: trunk/Source/WebCore/platform/mac/ThreadCheck.mm (196550 => 196551)
--- trunk/Source/WebCore/platform/mac/ThreadCheck.mm 2016-02-13 13:38:48 UTC (rev 196550)
+++ trunk/Source/WebCore/platform/mac/ThreadCheck.mm 2016-02-13 17:41:12 UTC (rev 196551)
@@ -35,7 +35,7 @@
static bool didReadThreadViolationBehaviorFromUserDefaults = false;
static bool threadViolationBehaviorIsDefault = true;
-static ThreadViolationBehavior threadViolationBehavior[MaximumThreadViolationRound] = { RaiseExceptionOnThreadViolation, RaiseExceptionOnThreadViolation };
+static ThreadViolationBehavior threadViolationBehavior[MaximumThreadViolationRound] = { RaiseExceptionOnThreadViolation, RaiseExceptionOnThreadViolation, RaiseExceptionOnThreadViolation };
static void readThreadViolationBehaviorFromUserDefaults()
{
Modified: trunk/Source/WebKit/mac/ChangeLog (196550 => 196551)
--- trunk/Source/WebKit/mac/ChangeLog 2016-02-13 13:38:48 UTC (rev 196550)
+++ trunk/Source/WebKit/mac/ChangeLog 2016-02-13 17:41:12 UTC (rev 196551)
@@ -1,3 +1,27 @@
+2016-02-13 Mark Lam <[email protected]>
+
+ Add thread violation checks to WebView public APIs.
+ https://bugs.webkit.org/show_bug.cgi?id=154183
+
+ Reviewed by Timothy Hatcher.
+
+ Re-landing r196527 with a newly added WebCoreThreadViolationCheckRoundThree().
+ Previously was using WebCoreThreadViolationCheckRoundTwo().
+
+ * Misc/WebKitVersionChecks.h:
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView initWithFrame:]):
+ * WebView/WebView.mm:
+ (-[WebView setCustomTextEncodingName:]):
+ (-[WebView stringByEvaluatingJavaScriptFromString:]):
+ (-[WebView windowScriptObject]):
+ (-[WebView setGroupName:]):
+ (-[WebView setMainFrameURL:]):
+ (-[WebView mainFrameTitle]):
+ (-[WebView mainFrameIcon]):
+ (-[WebView setDrawsBackground:]):
+ (-[WebView setShouldUpdateWhileOffscreen:]):
+
2016-02-12 Commit Queue <[email protected]>
Unreviewed, rolling out r196527.
Modified: trunk/Source/WebKit/mac/Misc/WebKitVersionChecks.h (196550 => 196551)
--- trunk/Source/WebKit/mac/Misc/WebKitVersionChecks.h 2016-02-13 13:38:48 UTC (rev 196550)
+++ trunk/Source/WebKit/mac/Misc/WebKitVersionChecks.h 2016-02-13 17:41:12 UTC (rev 196551)
@@ -51,6 +51,7 @@
#define WEBKIT_FIRST_VERSION_WITH_MORE_STRICT_LOCAL_RESOURCE_SECURITY_RESTRICTION 0x02100200 // 528.2.0
#define WEBKIT_FIRST_VERSION_WITHOUT_WEBVIEW_INIT_THREAD_WORKAROUND 0x02100700 // 528.7.0
#define WEBKIT_FIRST_VERSION_WITH_ROUND_TWO_MAIN_THREAD_EXCEPTIONS 0x02120400 // 530.4.0
+#define WEBKIT_FIRST_VERSION_WITH_ROUND_THREE_MAIN_THREAD_EXCEPTIONS 0x025A0113 // 602.1.19
#define WEBKIT_FIRST_VERSION_WITHOUT_BUMPERCAR_BACK_FORWARD_QUIRK 0x02120700 // 530.7.0
#define WEBKIT_FIRST_VERSION_WITHOUT_CONTENT_SNIFFING_FOR_FILE_URLS 0x02120A00 // 530.10.0
#define WEBKIT_FIRST_VERSION_WITHOUT_LINK_ELEMENT_TEXT_CSS_QUIRK 0x02130200 // 531.2.0
Modified: trunk/Source/WebKit/mac/WebView/WebFrameView.mm (196550 => 196551)
--- trunk/Source/WebKit/mac/WebView/WebFrameView.mm 2016-02-13 13:38:48 UTC (rev 196550)
+++ trunk/Source/WebKit/mac/WebView/WebFrameView.mm 2016-02-13 17:41:12 UTC (rev 196551)
@@ -381,6 +381,10 @@
bool throwExceptionsForRoundTwo = WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_ROUND_TWO_MAIN_THREAD_EXCEPTIONS);
if (!throwExceptionsForRoundTwo)
setDefaultThreadViolationBehavior(LogOnFirstThreadViolation, ThreadViolationRoundTwo);
+
+ bool throwExceptionsForRoundThree = WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_ROUND_THREE_MAIN_THREAD_EXCEPTIONS);
+ if (!throwExceptionsForRoundThree)
+ setDefaultThreadViolationBehavior(LogOnFirstThreadViolation, ThreadViolationRoundThree);
#endif
}
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (196550 => 196551)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2016-02-13 13:38:48 UTC (rev 196550)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2016-02-13 17:41:12 UTC (rev 196551)
@@ -5843,6 +5843,8 @@
- (void)setCustomTextEncodingName:(NSString *)encoding
{
+ WebCoreThreadViolationCheckRoundThree();
+
NSString *oldEncoding = [self customTextEncodingName];
if (encoding == oldEncoding || [encoding isEqualToString:oldEncoding])
return;
@@ -5867,6 +5869,8 @@
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script
{
+ WebCoreThreadViolationCheckRoundThree();
+
#if !PLATFORM(IOS)
// Return statements are only valid in a function but some applications pass in scripts
// prefixed with return (<rdar://problems/5103720&4616860>) since older WebKit versions
@@ -5889,6 +5893,8 @@
- (WebScriptObject *)windowScriptObject
{
+ WebCoreThreadViolationCheckRoundThree();
+
Frame* coreFrame = [self _mainCoreFrame];
if (!coreFrame)
return nil;
@@ -6154,6 +6160,8 @@
- (void)setGroupName:(NSString *)groupName
{
+ WebCoreThreadViolationCheckRoundThree();
+
if (_private->group)
_private->group->removeWebView(self);
@@ -6244,6 +6252,8 @@
- (void)setMainFrameURL:(NSString *)URLString
{
+ WebCoreThreadViolationCheckRoundThree();
+
NSURL *url;
if ([URLString hasPrefix:@"/"])
url = "" fileURLWithPath:URLString];
@@ -6270,6 +6280,8 @@
- (NSString *)mainFrameTitle
{
+ WebCoreThreadViolationCheckRoundThree();
+
NSString *mainFrameTitle = [[[self mainFrame] _dataSource] pageTitle];
return (mainFrameTitle != nil) ? mainFrameTitle : (NSString *)@"";
}
@@ -6277,6 +6289,8 @@
#if !PLATFORM(IOS)
- (NSImage *)mainFrameIcon
{
+ WebCoreThreadViolationCheckRoundThree();
+
return [[WebIconDatabase sharedIconDatabase] iconForURL:[[[[self mainFrame] _dataSource] _URL] _web_originalDataAsString] withSize:WebIconSmallSize];
}
#else
@@ -6303,6 +6317,8 @@
- (void)setDrawsBackground:(BOOL)drawsBackground
{
+ WebCoreThreadViolationCheckRoundThree();
+
if (_private->drawsBackground == drawsBackground)
return;
_private->drawsBackground = drawsBackground;
@@ -6318,6 +6334,8 @@
- (void)setShouldUpdateWhileOffscreen:(BOOL)updateWhileOffscreen
{
+ WebCoreThreadViolationCheckRoundThree();
+
if (_private->shouldUpdateWhileOffscreen == updateWhileOffscreen)
return;
_private->shouldUpdateWhileOffscreen = updateWhileOffscreen;