OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (c) 2009, 2012 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 execution_context->IsContextDestroyed()) | 46 execution_context->IsContextDestroyed()) |
47 return true; | 47 return true; |
48 if (!m_scriptState->ContextIsValid()) | 48 if (!m_scriptState->ContextIsValid()) |
49 return true; | 49 return true; |
50 ScriptState::Scope scope(m_scriptState.Get()); | 50 ScriptState::Scope scope(m_scriptState.Get()); |
51 | 51 |
52 v8::Local<v8::Value> transaction_handle = | 52 v8::Local<v8::Value> transaction_handle = |
53 ToV8(transaction, m_scriptState->GetContext()->Global(), isolate); | 53 ToV8(transaction, m_scriptState->GetContext()->Global(), isolate); |
54 v8::Local<v8::Value> error_handle = | 54 v8::Local<v8::Value> error_handle = |
55 ToV8(error, m_scriptState->GetContext()->Global(), isolate); | 55 ToV8(error, m_scriptState->GetContext()->Global(), isolate); |
56 ASSERT(transaction_handle->IsObject()); | 56 DCHECK(transaction_handle->IsObject()); |
57 | 57 |
58 v8::Local<v8::Value> argv[] = {transaction_handle, error_handle}; | 58 v8::Local<v8::Value> argv[] = {transaction_handle, error_handle}; |
59 | 59 |
60 v8::TryCatch exception_catcher(isolate); | 60 v8::TryCatch exception_catcher(isolate); |
61 exception_catcher.SetVerbose(true); | 61 exception_catcher.SetVerbose(true); |
62 | 62 |
63 v8::Local<v8::Value> result; | 63 v8::Local<v8::Value> result; |
64 // FIXME: This comment doesn't make much sense given what the code is actually | 64 // FIXME: This comment doesn't make much sense given what the code is actually |
65 // doing. | 65 // doing. |
66 // | 66 // |
67 // Step 6: If the error callback returns false, then move on to the next | 67 // Step 6: If the error callback returns false, then move on to the next |
68 // statement, if any, or onto the next overall step otherwise. Otherwise, | 68 // statement, if any, or onto the next overall step otherwise. Otherwise, |
69 // the error callback did not return false, or there was no error callback. | 69 // the error callback did not return false, or there was no error callback. |
70 // Jump to the last step in the overall steps. | 70 // Jump to the last step in the overall steps. |
71 if (!V8ScriptRunner::CallFunction(m_callback.NewLocal(isolate), | 71 if (!V8ScriptRunner::CallFunction(m_callback.NewLocal(isolate), |
72 m_scriptState->GetExecutionContext(), | 72 m_scriptState->GetExecutionContext(), |
73 m_scriptState->GetContext()->Global(), | 73 m_scriptState->GetContext()->Global(), |
74 WTF_ARRAY_LENGTH(argv), argv, isolate) | 74 WTF_ARRAY_LENGTH(argv), argv, isolate) |
75 .ToLocal(&result)) | 75 .ToLocal(&result)) |
76 return true; | 76 return true; |
77 bool value; | 77 bool value; |
78 if (!result->BooleanValue(isolate->GetCurrentContext()).To(&value)) | 78 if (!result->BooleanValue(isolate->GetCurrentContext()).To(&value)) |
79 return true; | 79 return true; |
80 return value; | 80 return value; |
81 } | 81 } |
82 | 82 |
83 } // namespace blink | 83 } // namespace blink |
OLD | NEW |