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

Side by Side Diff: Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp

Issue 929953002: CachedMetadata support for ServiceWorker script. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007-2011 Google Inc. All rights reserved. 2 * Copyright (C) 2007-2011 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } 381 }
382 382
383 v8::Handle<v8::String> expression = info[0]->ToString(isolate); 383 v8::Handle<v8::String> expression = info[0]->ToString(isolate);
384 if (expression.IsEmpty()) { 384 if (expression.IsEmpty()) {
385 isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(iso late, "The argument must be a string."))); 385 isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(iso late, "The argument must be a string.")));
386 return; 386 return;
387 } 387 }
388 388
389 ASSERT(isolate->InContext()); 389 ASSERT(isolate->InContext());
390 v8::TryCatch tryCatch; 390 v8::TryCatch tryCatch;
391 v8::Handle<v8::Script> script = V8ScriptRunner::compileScript(expression, St ring(), TextPosition(), 0, 0, isolate); 391 v8::Handle<v8::Script> script = V8ScriptRunner::compileScript(expression, St ring(), TextPosition(), 0, 0, 0, isolate);
vivekg 2015/02/16 08:31:49 nit: Now that all our bots support the C++11, usin
horo 2015/02/16 08:57:44 Done.
392 v8::Handle<v8::Value> result = V8ScriptRunner::runCompiledScript(isolate, sc ript, currentExecutionContext(isolate)); 392 v8::Handle<v8::Value> result = V8ScriptRunner::runCompiledScript(isolate, sc ript, currentExecutionContext(isolate));
393 393
394 v8::Local<v8::Object> wrappedResult = v8::Object::New(isolate); 394 v8::Local<v8::Object> wrappedResult = v8::Object::New(isolate);
395 if (tryCatch.HasCaught()) { 395 if (tryCatch.HasCaught()) {
396 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), tryCatch. Exception()); 396 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), tryCatch. Exception());
397 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"), JavaScriptCallFrame::createExceptionDetails(isolate, tryCatch.Message())); 397 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"), JavaScriptCallFrame::createExceptionDetails(isolate, tryCatch.Message()));
398 } else { 398 } else {
399 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), result); 399 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), result);
400 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"), v8::Undefined(isolate)); 400 wrappedResult->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"), v8::Undefined(isolate));
401 } 401 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 void V8InjectedScriptHost::setNonEnumPropertyMethodCustom(const v8::FunctionCall backInfo<v8::Value>& info) 531 void V8InjectedScriptHost::setNonEnumPropertyMethodCustom(const v8::FunctionCall backInfo<v8::Value>& info)
532 { 532 {
533 if (info.Length() < 3 || !info[0]->IsObject() || !info[1]->IsString()) 533 if (info.Length() < 3 || !info[0]->IsObject() || !info[1]->IsString())
534 return; 534 return;
535 535
536 v8::Local<v8::Object> object = info[0]->ToObject(info.GetIsolate()); 536 v8::Local<v8::Object> object = info[0]->ToObject(info.GetIsolate());
537 object->ForceSet(info[1], info[2], v8::DontEnum); 537 object->ForceSet(info[1], info[2], v8::DontEnum);
538 } 538 }
539 539
540 } // namespace blink 540 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698