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

Side by Side Diff: ppapi/tests/test_utils.cc

Issue 9381010: Convert resources to take an instance key instead of an Instance*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: USELESS PATCH TITLE Created 8 years, 9 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 | « ppapi/tests/test_url_util.cc ('k') | ppapi/tests/test_websocket.cc » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/tests/test_utils.h" 5 #include "ppapi/tests/test_utils.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #if defined(_MSC_VER) 9 #if defined(_MSC_VER)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 bool GetLocalHostPort(PP_Instance instance, std::string* host, uint16_t* port) { 44 bool GetLocalHostPort(PP_Instance instance, std::string* host, uint16_t* port) {
45 if (!host || !port) 45 if (!host || !port)
46 return false; 46 return false;
47 47
48 const PPB_Testing_Dev* testing = GetTestingInterface(); 48 const PPB_Testing_Dev* testing = GetTestingInterface();
49 if (!testing) 49 if (!testing)
50 return false; 50 return false;
51 51
52 PP_URLComponents_Dev components; 52 PP_URLComponents_Dev components;
53 pp::Var pp_url(pp::Var::PassRef(), 53 pp::Var pp_url(pp::PASS_REF,
54 testing->GetDocumentURL(instance, &components)); 54 testing->GetDocumentURL(instance, &components));
55 if (!pp_url.is_string()) 55 if (!pp_url.is_string())
56 return false; 56 return false;
57 std::string url = pp_url.AsString(); 57 std::string url = pp_url.AsString();
58 58
59 if (components.host.len < 0) 59 if (components.host.len < 0)
60 return false; 60 return false;
61 host->assign(url.substr(components.host.begin, components.host.len)); 61 host->assign(url.substr(components.host.begin, components.host.len));
62 62
63 if (components.port.len <= 0) 63 if (components.port.len <= 0)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 TestCompletionCallback* callback = 112 TestCompletionCallback* callback =
113 static_cast<TestCompletionCallback*>(user_data); 113 static_cast<TestCompletionCallback*>(user_data);
114 callback->result_ = result; 114 callback->result_ = result;
115 callback->have_result_ = true; 115 callback->have_result_ = true;
116 callback->run_count_++; 116 callback->run_count_++;
117 if (callback->post_quit_task_) { 117 if (callback->post_quit_task_) {
118 callback->post_quit_task_ = false; 118 callback->post_quit_task_ = false;
119 GetTestingInterface()->QuitMessageLoop(callback->instance_); 119 GetTestingInterface()->QuitMessageLoop(callback->instance_);
120 } 120 }
121 } 121 }
OLDNEW
« no previous file with comments | « ppapi/tests/test_url_util.cc ('k') | ppapi/tests/test_websocket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698