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

Side by Side Diff: webkit/plugins/npapi/test/plugin_get_javascript_url_test.cc

Issue 8817014: Add a non-null check for a pointer to NPAPIClient::ExecuteGetJavascriptUrlTest::TimerProc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 | 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 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/plugins/npapi/test/plugin_get_javascript_url_test.h" 5 #include "webkit/plugins/npapi/test/plugin_get_javascript_url_test.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h"
8 9
9 // url for "self". 10 // url for "self".
10 #define SELF_URL "javascript:window.location+\"\"" 11 #define SELF_URL "javascript:window.location+\"\""
11 // The identifier for the self url stream. 12 // The identifier for the self url stream.
12 #define SELF_URL_STREAM_ID 1 13 #define SELF_URL_STREAM_ID 1
13 14
14 // The identifier for the fetched url stream. 15 // The identifier for the fetched url stream.
15 #define FETCHED_URL_STREAM_ID 2 16 #define FETCHED_URL_STREAM_ID 2
16 17
17 // The maximum chunk size of stream data. 18 // The maximum chunk size of stream data.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 61
61 return NPERR_NO_ERROR; 62 return NPERR_NO_ERROR;
62 } 63 }
63 64
64 #ifdef OS_WIN 65 #ifdef OS_WIN
65 void CALLBACK ExecuteGetJavascriptUrlTest::TimerProc( 66 void CALLBACK ExecuteGetJavascriptUrlTest::TimerProc(
66 HWND window, UINT message, UINT timer_id, unsigned long elapsed_time) { 67 HWND window, UINT message, UINT timer_id, unsigned long elapsed_time) {
67 ExecuteGetJavascriptUrlTest* this_instance = 68 ExecuteGetJavascriptUrlTest* this_instance =
68 reinterpret_cast<ExecuteGetJavascriptUrlTest*> 69 reinterpret_cast<ExecuteGetJavascriptUrlTest*>
69 (::GetProp(window, L"Plugin_Instance")); 70 (::GetProp(window, L"Plugin_Instance"));
71 CHECK(this_instance);
70 72
71 ::RemoveProp(window, L"Plugin_Instance"); 73 ::RemoveProp(window, L"Plugin_Instance");
72 74
73 NPObject *window_obj = NULL; 75 NPObject *window_obj = NULL;
74 this_instance->HostFunctions()->getvalue(this_instance->id(), 76 this_instance->HostFunctions()->getvalue(this_instance->id(),
75 NPNVWindowNPObject, 77 NPNVWindowNPObject,
76 &window_obj); 78 &window_obj);
77 if (!window_obj) { 79 if (!window_obj) {
78 this_instance->SetError("Failed to get NPObject for plugin instance2"); 80 this_instance->SetError("Failed to get NPObject for plugin instance2");
79 this_instance->SignalTestCompleted(); 81 this_instance->SignalTestCompleted();
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 SetError("Failed to obtain window location."); 211 SetError("Failed to obtain window location.");
210 SignalTestCompleted(); 212 SignalTestCompleted();
211 break; 213 break;
212 default: 214 default:
213 SetError("Unexpected NewStream callback"); 215 SetError("Unexpected NewStream callback");
214 break; 216 break;
215 } 217 }
216 } 218 }
217 219
218 } // namespace NPAPIClient 220 } // namespace NPAPIClient
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698