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

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

Issue 1305523003: [bindings] Make ScriptValue::v8ValueFor(...) a 'const' method. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | « Source/bindings/core/v8/ScriptValue.h ('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) 2008, 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return m_value->newLocal(isolate()); 55 return m_value->newLocal(isolate());
56 } 56 }
57 57
58 v8::Local<v8::Value> ScriptValue::v8ValueUnsafe() const 58 v8::Local<v8::Value> ScriptValue::v8ValueUnsafe() const
59 { 59 {
60 if (isEmpty()) 60 if (isEmpty())
61 return v8::Local<v8::Value>(); 61 return v8::Local<v8::Value>();
62 return m_value->newLocal(isolate()); 62 return m_value->newLocal(isolate());
63 } 63 }
64 64
65 v8::Local<v8::Value> ScriptValue::v8ValueFor(ScriptState* targetScriptState) 65 v8::Local<v8::Value> ScriptValue::v8ValueFor(ScriptState* targetScriptState) con st
66 { 66 {
67 if (isEmpty()) 67 if (isEmpty())
68 return v8::Local<v8::Value>(); 68 return v8::Local<v8::Value>();
69 v8::Isolate* isolate = targetScriptState->isolate(); 69 v8::Isolate* isolate = targetScriptState->isolate();
70 if (&m_scriptState->world() == &targetScriptState->world()) 70 if (&m_scriptState->world() == &targetScriptState->world())
71 return m_value->newLocal(isolate); 71 return m_value->newLocal(isolate);
72 72
73 ASSERT(isolate->InContext()); 73 ASSERT(isolate->InContext());
74 v8::Local<v8::Value> value = m_value->newLocal(isolate); 74 v8::Local<v8::Value> value = m_value->newLocal(isolate);
75 RefPtr<SerializedScriptValue> serialized = SerializedScriptValueFactory::ins tance().createAndSwallowExceptions(isolate, value); 75 RefPtr<SerializedScriptValue> serialized = SerializedScriptValueFactory::ins tance().createAndSwallowExceptions(isolate, value);
(...skipping 12 matching lines...) Expand all
88 result = toCoreString(v8::Local<v8::String>::Cast(string)); 88 result = toCoreString(v8::Local<v8::String>::Cast(string));
89 return true; 89 return true;
90 } 90 }
91 91
92 ScriptValue ScriptValue::createNull(ScriptState* scriptState) 92 ScriptValue ScriptValue::createNull(ScriptState* scriptState)
93 { 93 {
94 return ScriptValue(scriptState, v8::Null(scriptState->isolate())); 94 return ScriptValue(scriptState, v8::Null(scriptState->isolate()));
95 } 95 }
96 96
97 } // namespace blink 97 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptValue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698