a7d46eb5a6
Adds Dart_DefaultCanonicalizeUrl() to the dart embedding api. Motivation: As we try to get source reloading working for the standalone embedder, things get simpler if an isolate doesn't run Dart code while it is loading Dart code. We intend to solve this by moving the embedder tag handler calls to the service isolate. But making a blocking rpc into the service isolate whenever a url needs to be canonicalized during parsing seems like it would slow things down and make things complicated. By moving canonicalization into C++, we avoid this. R=ahe@google.com, fschneider@google.com, johnmccutchan@google.com Review URL: https://codereview.chromium.org/2011543002 .
34 lines
842 B
C++
34 lines
842 B
C++
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef VM_URI_H_
|
|
#define VM_URI_H_
|
|
|
|
#include "platform/utils.h"
|
|
#include "vm/globals.h"
|
|
|
|
namespace dart {
|
|
|
|
struct ParsedUri {
|
|
const char* scheme;
|
|
const char* userinfo;
|
|
const char* host;
|
|
const char* port;
|
|
const char* path;
|
|
const char* query;
|
|
const char* fragment;
|
|
};
|
|
|
|
// Parses a uri into its parts. Returns false if the parse fails.
|
|
bool ParseUri(const char* uri, ParsedUri* parsed_uri);
|
|
|
|
// Resolves some reference uri with respect to a base uri.
|
|
bool ResolveUri(const char* ref_uri,
|
|
const char* base_uri,
|
|
const char** target_uri);
|
|
|
|
} // namespace dart
|
|
|
|
#endif // VM_URI_H_
|