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

Side by Side Diff: ppapi/tests/test_tcp_socket_private.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_scrollbar.cc ('k') | ppapi/tests/test_url_loader.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_tcp_socket_private.h" 5 #include "ppapi/tests/test_tcp_socket_private.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "ppapi/c/dev/ppb_url_util_dev.h" 9 #include "ppapi/c/dev/ppb_url_util_dev.h"
10 #include "ppapi/cpp/dev/url_util_dev.h" 10 #include "ppapi/cpp/dev/url_util_dev.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 return false; 42 return false;
43 if (!testing->IsOutOfProcess()) 43 if (!testing->IsOutOfProcess())
44 return false; 44 return false;
45 45
46 // We need something to connect to, so we connect to the HTTP server whence we 46 // We need something to connect to, so we connect to the HTTP server whence we
47 // came. Grab the host and port. 47 // came. Grab the host and port.
48 if (!EnsureRunningOverHTTP()) 48 if (!EnsureRunningOverHTTP())
49 return false; 49 return false;
50 50
51 PP_URLComponents_Dev components; 51 PP_URLComponents_Dev components;
52 pp::Var pp_url = pp::URLUtil_Dev::Get()->GetDocumentURL(*instance_, 52 pp::Var pp_url = pp::URLUtil_Dev::Get()->GetDocumentURL(instance_,
53 &components); 53 &components);
54 if (!pp_url.is_string()) 54 if (!pp_url.is_string())
55 return false; 55 return false;
56 std::string url = pp_url.AsString(); 56 std::string url = pp_url.AsString();
57 57
58 // Double-check that we're running on HTTP. 58 // Double-check that we're running on HTTP.
59 if (components.scheme.len < 0) 59 if (components.scheme.len < 0)
60 return false; 60 return false;
61 if (url.substr(components.scheme.begin, components.scheme.len) != "http") 61 if (url.substr(components.scheme.begin, components.scheme.len) != "http")
62 return false; 62 return false;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 if (rv < 0) 208 if (rv < 0)
209 return rv; 209 return rv;
210 if (rv == 0) 210 if (rv == 0)
211 return PP_ERROR_FAILED; 211 return PP_ERROR_FAILED;
212 written += rv; 212 written += rv;
213 } 213 }
214 if (written != s.size()) 214 if (written != s.size())
215 return PP_ERROR_FAILED; 215 return PP_ERROR_FAILED;
216 return PP_OK; 216 return PP_OK;
217 } 217 }
OLDNEW
« no previous file with comments | « ppapi/tests/test_scrollbar.cc ('k') | ppapi/tests/test_url_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698