Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp

Issue 2039333002: Fixes ASan crash for an embedded Blink-in-JS component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ...now with test expectation. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/bindings/blink-in-js-asan-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 } 108 }
109 return emptyString(); 109 return emptyString();
110 } 110 }
111 111
112 static void messageHandlerInMainThread(v8::Local<v8::Message> message, v8::Local <v8::Value> data) 112 static void messageHandlerInMainThread(v8::Local<v8::Message> message, v8::Local <v8::Value> data)
113 { 113 {
114 ASSERT(isMainThread()); 114 ASSERT(isMainThread());
115 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 115 v8::Isolate* isolate = v8::Isolate::GetCurrent();
116 116
117 if (isolate->GetEnteredContext().IsEmpty())
118 return;
119
117 // If called during context initialization, there will be no entered context . 120 // If called during context initialization, there will be no entered context .
118 ScriptState* scriptState = ScriptState::current(isolate); 121 ScriptState* scriptState = ScriptState::current(isolate);
119 if (!scriptState->contextIsValid()) 122 if (!scriptState->contextIsValid())
120 return; 123 return;
121 124
122 ExecutionContext* context = scriptState->getExecutionContext(); 125 ExecutionContext* context = scriptState->getExecutionContext();
123 OwnPtr<SourceLocation> location = SourceLocation::fromMessage(isolate, messa ge, context); 126 OwnPtr<SourceLocation> location = SourceLocation::fromMessage(isolate, messa ge, context);
124 127
125 AccessControlStatus accessControlStatus = NotSharableCrossOrigin; 128 AccessControlStatus accessControlStatus = NotSharableCrossOrigin;
126 if (message->IsOpaque()) 129 if (message->IsOpaque())
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 430
428 isolate->AddMessageListener(messageHandlerInWorker); 431 isolate->AddMessageListener(messageHandlerInWorker);
429 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); 432 isolate->SetFatalErrorHandler(reportFatalErrorInWorker);
430 433
431 uint32_t here; 434 uint32_t here;
432 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi ze / sizeof(uint32_t*))); 435 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here - kWorkerMaxStackSi ze / sizeof(uint32_t*)));
433 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); 436 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker);
434 } 437 }
435 438
436 } // namespace blink 439 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/bindings/blink-in-js-asan-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698