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

Side by Side Diff: Source/bindings/core/v8/PrivateScriptRunner.cpp

Issue 368283002: Stream scripts to V8 as they load - Blink side. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: removed untrue assert Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptDebugServer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "bindings/core/v8/PrivateScriptRunner.h" 6 #include "bindings/core/v8/PrivateScriptRunner.h"
7 7
8 #include "bindings/core/v8/DOMWrapperWorld.h" 8 #include "bindings/core/v8/DOMWrapperWorld.h"
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/V8Binding.h" 10 #include "bindings/core/v8/V8Binding.h"
(...skipping 27 matching lines...) Expand all
38 int lineNumber = message->GetLineNumber(); 38 int lineNumber = message->GetLineNumber();
39 v8::Handle<v8::String> errorMessage = message->Get(); 39 v8::Handle<v8::String> errorMessage = message->Get();
40 fprintf(stderr, "%s (line %d): %s\n", fileName.utf8().data(), lineNumber, to CoreString(errorMessage).utf8().data()); 40 fprintf(stderr, "%s (line %d): %s\n", fileName.utf8().data(), lineNumber, to CoreString(errorMessage).utf8().data());
41 } 41 }
42 42
43 static v8::Handle<v8::Value> compileAndRunPrivateScript(v8::Isolate* isolate, St ring scriptClassName, const char* source, size_t size) 43 static v8::Handle<v8::Value> compileAndRunPrivateScript(v8::Isolate* isolate, St ring scriptClassName, const char* source, size_t size)
44 { 44 {
45 v8::TryCatch block; 45 v8::TryCatch block;
46 String sourceString(source, size); 46 String sourceString(source, size);
47 String fileName = scriptClassName + ".js"; 47 String fileName = scriptClassName + ".js";
48 v8::Handle<v8::Script> script = V8ScriptRunner::compileScript(v8String(isola te, sourceString), fileName, TextPosition::minimumPosition(), 0, isolate, NotSha rableCrossOrigin, V8CacheOptionsOff); 48 v8::Handle<v8::Script> script = V8ScriptRunner::compileScript(v8String(isola te, sourceString), fileName, TextPosition::minimumPosition(), 0, 0, isolate, Not SharableCrossOrigin, V8CacheOptionsOff);
49 if (block.HasCaught()) { 49 if (block.HasCaught()) {
50 fprintf(stderr, "Private script error: Compile failed. (Class name = %s) \n", scriptClassName.utf8().data()); 50 fprintf(stderr, "Private script error: Compile failed. (Class name = %s) \n", scriptClassName.utf8().data());
51 dumpV8Message(block.Message()); 51 dumpV8Message(block.Message());
52 RELEASE_ASSERT_NOT_REACHED(); 52 RELEASE_ASSERT_NOT_REACHED();
53 } 53 }
54 54
55 v8::Handle<v8::Value> result = V8ScriptRunner::runCompiledInternalScript(scr ipt, isolate); 55 v8::Handle<v8::Value> result = V8ScriptRunner::runCompiledInternalScript(scr ipt, isolate);
56 if (block.HasCaught()) { 56 if (block.HasCaught()) {
57 fprintf(stderr, "Private script error: installClass() failed. (Class nam e = %s)\n", scriptClassName.utf8().data()); 57 fprintf(stderr, "Private script error: installClass() failed. (Class nam e = %s)\n", scriptClassName.utf8().data());
58 dumpV8Message(block.Message()); 58 dumpV8Message(block.Message());
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 exceptionState.throwIfNeeded(); 266 exceptionState.throwIfNeeded();
267 return; 267 return;
268 } 268 }
269 269
270 fprintf(stderr, "Private script error: %s was thrown.\n", exceptionName.utf8 ().data()); 270 fprintf(stderr, "Private script error: %s was thrown.\n", exceptionName.utf8 ().data());
271 dumpV8Message(tryCatchMessage); 271 dumpV8Message(tryCatchMessage);
272 RELEASE_ASSERT_NOT_REACHED(); 272 RELEASE_ASSERT_NOT_REACHED();
273 } 273 }
274 274
275 } // namespace blink 275 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptDebugServer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698